import { hospRequest } from '@/request'

// 获取医院设置分页列表
export const getHospSetList = (page: number, limit: number, params: any = {}) => {
    return hospRequest.get(`/admin/hosp/hospitalSet/${page}/${limit}`, {
        params
    })
}

// 医院设置锁定状态
export const lockHospSet = (id: number, status: number) => {
    status = status === 0 ? 1 : 0
    return hospRequest.get(`/admin/hosp/hospitalSet/lock/${id}/${status}`)
}

// 添加医院设置
export const addHospSet = (data: any) => {
    return hospRequest.post(`/admin/hosp/hospitalSet/save`, data)
}
// 修改医院设置
export const updateHospSet = (data: any) => {
    return hospRequest.put(`/admin/hosp/hospitalSet/update`, data)
}
// 删除医院设置
export const deleteHospSet = (id: number) => {
    return hospRequest.delete(`/admin/hosp/hospitalSet/remove/${id}`)
}

// 批量删除医院设置
export const batchDeleteHospSet = (idList: any) => {
    return hospRequest.delete(`/admin/hosp/hospitalSet/batchRemove`, {
        data: idList
    })
}

// 获取医院列表
export const getHospList = (page: number, limit: number, params: any = {}) => {
    return hospRequest.get(`/admin/hosp/hospital/${page}/${limit}`, {
        params
    })
}

// 医院列表上线状态
export const lockHospList = (id: string, status: number) => {
    status = status === 0 ? 1 : 0
    return hospRequest.get(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}

// 获取医院详情
export const getHospDetail = (id: string) => {
    return hospRequest.get(`/admin/hosp/hospital/show/${id}`)
}

// 获取科室列表
export const getDeptList = (hoscode: string) => {
    return hospRequest.get(`/admin/hosp/department/${hoscode}`)
}

// 获取排班规则数据
export const getScheduleRule = (page: number, limit: number, hoscode: string, depcode: string) => {
    return hospRequest.get(`/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}

// 获取workDate排班日期的排班详细列表
export const getFindScheduleList = (hoscode: string, depcode: string, workDate: string) => {
    return hospRequest.get(`/admin/hosp/schedule/findScheduleList/${hoscode}/${depcode}/${workDate}`)
}
